<!DOCTYPE html>
<html lang="en">
<head>
	<meta charset="UTF-8">
	<title>{:C('SERVER_NAME')}</title>
	<link rel="stylesheet" type="text/css" href="__PUBLICADMIN__/css/style.css">
</head>
<body>
	<div class="content p50">
		<div class="content-title"><h2>代写服务列表</h2></div>
		<div class="p20">
		<form action="__ACTION__.html">
			<div class="search-box">				
				<span class="search-title">用户名：</span><span class="search fl"><input type="text" name="secuname" value="{$_GET['secuname']}" placeholder="请输入"></span>
				<span class="search-title">标题：</span><span class="search fl"><input type="text" name="sectitle" value="{$_GET['sectitle']}" placeholder="请输入"></span>
				<span class="search-title">状态：</span><span class="search-select">
				<select name="secstatus">
					<option value="">请选择</option>
					<option value="0">未审核</option>
					<option value="1">已通过</option>
					<option value="2">未通过</option>
				</select>
				</span>
				<input type="submit" class="search-btn fl" value="">
			</div>
		</form>	
			<table class="table">
				<thead>
					<tr>
						<th>序号</th>
						<th>标题</th>
						<th>用户名</th>
						<th>类型</th>
						<th>套餐</th>
						<th>金额</th>
						<th>提交时间</th>
						<th>状态</th>
						<th>完成情况</th>		
						<th>操作</th>
					</tr>
				</thead>
				<tbody>				
				<volist id="vo" name="writeList">
					<tr>
						<td>{$key+1}</td>
						<td>{$vo.title}</td>
						<td>{$vo.userName}</td>
						<td>{$vo.typeName}</td>
						<td>{$vo.packageName}</td>
						<td>{$vo.money}</td>
						<td>{$vo.commit_time}</td>
						<td><php>echo $apply_status[$vo["is_apply"]];</php></td>
						<td><php>echo $ok_status[$vo["is_ok"]];</php></td>
						<td>
						<if condition="$vo['is_apply'] eq 1 and $vo['is_ok'] eq 0">
							<a href="javascript:;" class="change_write" data-type="ok" data-status="1" data-id="{$vo.id}">确定完成</a>|
						</if>
						<if condition="$vo['is_apply'] eq 0">
							<a href="javascript:;" class="change_write" data-type="apply" data-status="1" data-id="{$vo.id}">通过</a>
							<a href="javascript:;" class="change_write" data-type="apply" data-status="2" data-id="{$vo.id}">不通过</a>|
						</if>
						<a href="{:U('Write/writeDetail',array('id'=>$vo['id']))}">详情</a>
						</td>
					</tr>
				</volist>	
				</tbody>
			</table>
			<div class="page">
			{$page}
			</div>
		</div>
	</div>
	<include file="Public/ok"/>
	<include file="Public/okcancel"/>
	<script type="text/javascript" src="__PUBLIC__/js/jquery-1.7.min.js"></script>
	<script type="text/javascript" src="__PUBLICADMIN__/js/page.js"></script>
	<script type="text/javascript">

		$(function(){
			$("select[name=secstatus]").val("{$_GET['secstatus']}");
		});
		//审核代写
		$(".change_write").click(function(){

			var _this=$(this);
			modelConfirm("确定后无法更改，是否确定",function(){

				var type=_this.attr("data-type");
				var status=_this.attr("data-status");
				var id=_this.attr("data-id");

				if(!type || !status || !id){
					prompting("参数出错，请刷新后重试！");
					return false;
				}

				$.post("__URL__/ajaxChangeWrite",{"type":type,"ids":id,"status":status},function(data){

					modelConfirm(data.info,function(){
						window.location.reload();
					},function(){
						window.location.reload();
					});
				});
			});
		});
	</script>
</body>
</html>